package cn.cs.mapper;
import cn.cs.pojo.ClientUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface ClientUserMapper {

	public ClientUser getClientUserById(@Param(value = "id") String id)throws Exception;

	public ClientUser getClientUserByAccount(@Param(value = "account") String account)throws Exception;

	public ClientUser getClientUserByPhone(@Param(value = "phone") String phone)throws Exception;

	public List<ClientUser> getClientUserByLikePhone(@Param(value = "phone") String phone)throws Exception;

	public ClientUser getClientUserByOpenIdAccountNull(@Param(value = "openId") String openId)throws Exception;

	public List<ClientUser> getClientUserListByMap(Map<String, Object> param)throws Exception;

	public Integer getClientUserCountByMap(Map<String, Object> param)throws Exception;

	public Integer insertClientUser(ClientUser clientUser)throws Exception;

	public Integer updateClientUser(ClientUser clientUser)throws Exception;

	public Integer updateClientUserByOpenId(ClientUser clientUser)throws Exception;

	public Integer updateClientUsersByOpenId(ClientUser clientUser)throws Exception;

	public Integer deleteClientUserById(@Param(value = "id") Long id)throws Exception;
    //根据客户的openid判断是否存在该客户
	public ClientUser getClientUserByOpenId(@Param(value = "openId") String openId);

	public Map<String, Object> getWxVersionCode()throws Exception;

	public Integer setWxVersionCode(@Param(value = "versionCode") String versionCode)throws Exception;

	public List<Map<String, Object>> getUserByRepUserId(@Param(value = "rep_user_id") String rep_user_id)throws Exception;

	public Integer saveUserScoreHistory(Map<String, Object> map)throws Exception;

	public List<Map<String, Object>> getUserScoreHistoryByUserId(@Param(value = "userId") String userId)throws Exception;

}
